/* * The WeightedGrade Class has mutator methods setPointsEarned(int pEarned), setPointsPossible(int pPossible).
 * When you complete this class, write your own test to make sure it works correctly!
 */
public class WeightedGrade {
	int pointsEarned, pointsPossible;

	public WeightedGrade() {
		this(0, 0);
	}

	public WeightedGrade(int pEarned, int pPossible) {
		setPointsPossible(pPossible);
		setPointsEarned(pEarned);
	}

	public double getPointsEarned() {
		return pointsEarned;
	}

	public double getPointsPossible() {
		return pointsPossible;
	}

	public void setPointsEarned(int pEarned) {
		pointsEarned = pEarned;
	}

	public void setPointsPossible(int pPossible) {
		pointsPossible = pPossible;
	}

	public double getPercent() {
		return getPointsEarned() / getPointsPossible();
	}

	public String getLetterGrade() {
		double numGrade = pointsEarned / pointsPossible * 100;
		// Put your code here
		if (numGrade >= 100)
			return "A+";
		if (numGrade >= 91)
			return "A";
		if (numGrade >= 81)
			return "B";
		if (numGrade >= 71)
			return "C";
		if (numGrade >= 65)
			return "D";
		if (numGrade >= 0)
			return "F";
		return ("You did real bad.");
	}

}
